import os
from datetime import timedelta
from app.core.security import create_access_token

# 设置环境变量
os.environ["JWT_SECRET_KEY"] = "your-secret-key-here"
os.environ["JWT_ALGORITHM"] = "HS256"
os.environ["JWT_ACCESS_TOKEN_EXPIRE_MINUTES"] = "1440"

# 使用有效的用户ID生成token
token_data = {
    "user_id": "68f8a140fa543856d5facea7",  # admin用户的ID
    "email": "admin@example.com",
    "roles": ["admin"],
    "permissions": ["*"]
}

access_token = create_access_token(
    data=token_data,
    expires_delta=timedelta(minutes=1440)
)

print(f"Bearer {access_token}")